import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import {RegisterUtils} from "./app-register"
import ElementPlus from 'element-plus'  //引入element-plus库
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import router from './router'
import eventBus from 'vue3-eventbus'
import store from '@/store/index'
import "@/assets/css/font-awesome-min.css";
import 'element-plus/dist/index.css'
import VForm3 from 'vform3-builds'  //引入VForm 3库
import 'vform3-builds/dist/designer.style.css'  //引入VForm3样式
import hljs from 'highlight.js'
import 'highlight.js/styles/atelier-savanna-dark.css'
// import './assets/css/theme-green/index.css'; // 浅绿色主题
const app:any = createApp(App)
// 注册elementplus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
RegisterUtils(app);//注册工具类
app.use(ElementPlus)  //全局注册element-plus
app.use(VForm3)

//自定义一个代码高亮指令
app.directive('highlight', function (el) {
    const blocks = el.querySelectorAll('pre code');
    blocks.forEach((block: any) => {
        hljs.highlightBlock(block)
    })
})


app.use(store).use(router).use(eventBus).mount('#app');
